
// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the LOGICSPRITES_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// LOGICSPRITES_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#ifdef LOGICSPRITES_EXPORTS
#define LOGICSPRITES_API __declspec(dllexport)
#else
#define LOGICSPRITES_API __declspec(dllimport)
#endif

#if !defined(AFX_BaseLogicSprite_H__INCLUDED_)
#define AFX_BaseLogicSprite_H__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "..\MapViewer\StructureAndConst.h"

#ifdef TEST_COLLAPSE
static unsigned int nStaticLgIdx=0;
#endif

#define HIT(a,b) !((a).left>(b).right||(a).right<(b).left||(a).top>(b).bottom||(a).bottom<(b).top)
// This class is exported from the LogicSprites.dll
class LOGICSPRITES_API BaseLogicSprite {
public:
	BaseLogicSprite(void);
	virtual void Update(DWORD dwCurrentTime)=0;
	virtual long Hit(RECT rect,list<RectInBalloonElemnet_t>& listRect,bool bAffect=true);
	void SetPos(D3DXVECTOR2 vPosition){m_vPosition=vPosition;}
	D3DXVECTOR2 GetPos(){return m_vPosition;}
	bool GetShow(){return m_bShow;}
	LogicSpriteClass_e GetClassTpye(){return m_eClassName;}
	virtual unsigned int GetHitRect(RectInBalloonElemnet_t *&pRect);
	//virtual void GetHitRect(vector<RectInBalloonElemnet_t> &Rect);
#ifdef TEST_COLLAPSE
	unsigned int m_nIdx;
#endif

protected:
    D3DXVECTOR2 m_vPosition;
	bool m_bShow;

	vector<RectInBalloonElemnet_t> m_vecHitRect;
	LogicSpriteClass_e m_eClassName;
};

#endif

// extern LOGICSPRITES_API int nLogicSprites;
// 
// LOGICSPRITES_API int fnLogicSprites(void);

